<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('tasks', function (Blueprint $table) {
            $table->id();
            $table->string('title'); // 任务标题
            $table->string('description')->nullable(); // 任务描述
            $table->enum('status', ['pending', 'in_progress', 'completed', 'on_hold', 'cancelled', 'overdue '])->default('pending');
            //Pending: 待处理 in_progress: 进行中 completed: 已完成 on_hold: 暂停 Cancelled: 已取消 Overdue: 逾期
            $table->timestamps();
        });
    }       

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('tasks');
    }
};
